package com.mianyang.zhangsan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mianyang.zhangsan.model.entity.SecNotice;
import com.mianyang.zhangsan.service.ISecHallService;
import com.mianyang.zhangsan.service.SecNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jiangjr
 * @date 2023-01-17
 */
@Service
public class SecHallServiceImpl implements ISecHallService {
    @Autowired
    private SecNoticeService noticeService;


    @Override
    public List<SecNotice> recentNotice(int type, int top) {
        QueryWrapper<SecNotice> wrapper = new QueryWrapper<>();
        wrapper.eq("notice_type", type);
        Page<SecNotice> page = noticeService.page(new Page<>(0, top), wrapper);
        return page.getRecords();
    }
}
